package org.ceteca.explica.core.common;

import java.util.Collection;

import org.apache.log4j.Logger;
import org.ceteca.explica.client.ClientContext;
import org.ceteca.explica.client.gui.common.CommonClient;
import org.ceteca.explica.core.installer.EntityLauncher;
import org.ceteca.explica.core.installer.EntityOT;
import org.ceteca.explica.core.installer.SubentityOT;
import org.ceteca.javaglade.toolkit.swt.SwtWidget;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.Widget;

public class MultiSelectionSubentityOT extends SubentityOT {
	private SwtWidget panel;
	private String  collectionName;
	private String subentityWidgetName;
	private Collection<BaseVO> collection;
	private EntityLauncher subentityLauncher;
	
	public Collection<BaseVO> getCollection() {
		return collection;
	}
	public void setCollection(Collection<BaseVO> collection) {
		this.collection = collection;
	}

	public String getCollectionName() {
		return collectionName;
	}
	public void setCollectionName(String collectionName) {
		this.collectionName = collectionName;
	}
	
	public String getSubentityWidgetName() {
		return subentityWidgetName;
	}
	public void setSubentityWidgetName(String subentityWidgetName) {
		this.subentityWidgetName = subentityWidgetName;
	}
	
	public EntityLauncher getSubentityLauncher() {
		return subentityLauncher;
	}
	public void setSubentityLauncher(EntityLauncher subentityLauncher) {
		this.subentityLauncher = subentityLauncher;
	}

	/*
	public MultiSelectionSubentityOT(EntityOT subentityData, String parentFieldId,
			EntityLauncher parentEntity) {
		super(subentityData, parentFieldId, parentEntity);
		
	}
	
	
	public MultiSelectionSubentityOT(String entityId,String subentityWidgetName, EntityLauncher parentEntityLauncher){
		super();
		this.setParentEntity(parentEntityLauncher);
		this.setParentFieldId(subentityWidgetName);
		this.setSubentityData(ClientContext.getInstance().getEntity(entityId));
	}
*/
	public MultiSelectionSubentityOT(String entityId, String subentityWidgetName, EntityLauncher parentEntityLauncher, SwtWidget widget, String collectionName, String parentFieldId){
		super();
		this.setParentEntity(parentEntityLauncher);
		this.setSubentityWidgetName(subentityWidgetName);
		this.setParentFieldId(parentFieldId);
		this.setSubentityData(ClientContext.getInstance().getEntity(entityId));
		this.panel = widget;
		this.collectionName=collectionName;
	}
	
	public String toString(){
		StringBuilder sb=new StringBuilder();
		return sb.toString();
	}

	public SwtWidget getPanel() {
		return panel;
	}
	
	public Composite getPanelWidget() {
		return panel!=null?(Composite)panel.getWidgetObj():null;
	}


	public void setPanel(SwtWidget panel) {
		this.panel = panel;
	}
}
